package com.deepocean.service.impl;

import com.deepocean.dao.JigDao;
import com.deepocean.entity.*;
import com.deepocean.service.IJigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class JigServiceImpl implements IJigService {
    @Autowired
    JigDao jigDao;
    @Override
    public boolean add(JigEntity jigEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        jigEntity.setId(id);
        return jigDao.add(jigEntity);
    }

    @Override
    public JigInAndOut1Hour getInAndOutInHour(String deviceId) {
        return jigDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<JigEntity> getJigCondition(JigCondition jigCondition) {
        return jigDao.getJigByCondition(jigCondition);
    }
}
